#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#define N 1000000000

int main() 
{
  	double x, y;
	struct drand48_data randBuffer;
 	srand48_r(time(NULL), &randBuffer);
	long long int i;
	double c = 0;

	for(i = 0; i < N; i++)
	{	  	
		drand48_r(&randBuffer, &x);
		drand48_r(&randBuffer, &y);
		if(sqrt(x*x + y*y) <= 1)
		{
			c++;
		}
	}
	printf("%.6lf", 4*(c/N));	
	return EXIT_SUCCESS;
}
